package Day2025_04_14;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long x = in.nextLong();
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextLong();
            if (arr[i] <= x) x += arr[i];
            else x += num(x, arr[i]);
        }
        System.out.println(x);
    }

    private static long num (long x, long y) {
        while (true) {
            if (y == 0) break;
            long tmp = x % y;
            x = y;
            y = tmp;
        }
        return x;
    }
}
